<template>
  <view class="expert" id="expert">
    <view class="health-title">
      <view>专家提示</view>
      <view>
        <image src="@/static/index/right.png" class="prompt-style"></image>
        <!-- <view class="dis">评分说明</view> -->
      </view>
    </view>

    <view
      class="aricle"
      v-for="(item, index) in articleList"
      :key="index"
      @click="toHealthReport(item)"
    >
      <image :src="item.img" :lazy-load="true" class="image"></image>
      <view style="flex: 1">
        <view class="u-line-2 article-title"> {{ item.title }}</view>
        <view class="u-line-3 article-content">{{ item.content }}</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    articles: {
      type: Array,
    },
  },
  data() {
    return {
      articleList: [
        // {
        //   title: "宝宝每天喝多少牛奶才够？",
        //   image: "https://s1.ax1x.com/2020/11/05/BWk3pn.jpg",
        //   content:
        //     "头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...",
        // },
        // {
        //   title: "这样运动宝宝能长高吗？",
        //   image: "https://s1.ax1x.com/2020/11/05/BWE2JH.jpg",
        //   content:
        //     "头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...",
        // },
        // {
        //   title: "孩子跑步姿势正确吗？",
        //   image: "https://s1.ax1x.com/2020/11/05/BWk8lq.jpg",
        //   content:
        //     "头和肩：保持头与肩的稳定。头要正对前方，除非道路不平，不要前探，两眼注视前方。肩部适当...",
        // },
      ],
    };
  },
  methods: {
    /**
     * 健康质询
     */
    toHealthReport(Info) {
      this.$u.vuex('vuex_article',Info)
      this.$u.route({
        url: "pages/article/article",
        params: Info,
      });
    },
  },
  watch: {
    articles: {
      handler(newV, oldV) {
        this.articleList = newV;
      },
      deep: true,
      // immediate: true,
    },
  },
};
</script>

<style scoped lang ='scss' >
.expert {
  background-color: #ffffff;
  padding: 20rpx;
  margin-top: 30rpx;
  margin: 30rpx 0;
  border-radius: 20rpx;
  .health-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    & > view:nth-child(1) {
      color: #000000;
      font-size: 32rpx;
      font-weight: bold;
      font-family: SourceHanSansSC-Bold;
    }
    & > view:nth-child(2) {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      .prompt-style {
        width: 10.6rpx;
        height: 20rpx;
        margin-right: 4rpx;
      }
      .dis {
        color: #333333;
        font-size: 24rpx;
        font-family: SourceHanSansSC-Regular;
        font-weight: Regular;
      }
    }
  }
  .aricle {
    height: 78 * 2rpx;
    margin-bottom: 40rpx;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 25rpx;
    .image {
      width: 233rpx;
      height: 100%;
      margin-right: 20rpx;
      border-radius: 10rpx;
    }
    .article-title {
      font-weight: Bold;
      font-size: 28rpx;
      font-family: SourceHanSansCN-Bold;
      color: #333333;
      margin-bottom: 15rpx;
    }
    .article-content {
      font-size: 24rpx;
      color: #666666;
      font-weight: Regular;
      text-align: justify;
    }
  }
}
</style>
